#ifndef QGRAPHICDIALOG_H
#define QGRAPHICDIALOG_H

#include <QDialog>
#include <QGridLayout>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QDialogButtonBox>


namespace Ui {
class QGraphicDialog;
}

class QGraphicDialog : public QDialog
{
    Q_OBJECT

public:
    explicit QGraphicDialog(QWidget *parent = nullptr);
    ~QGraphicDialog();

public slots:
    void validateText();
    void validateDiameter();
    void validateColor();
    void onSelectColor();
    void onOk();

signals:
    void closed(QColor *color, QString text, int diameter);

private:
    Ui::QGraphicDialog *ui;

    QGridLayout *mainLayout;
    QLabel *textLabel;
    QLineEdit *textEdit;
    QLabel *diameterLabel;
    QLineEdit *diameterEdit;
    QPushButton *selectColorButton;
    QDialogButtonBox *buttonBox;

    QColor *color;

    bool textValidationFailed;
    bool diameterValidationFailed;
    bool colorValidationFailed;

    bool okEnabled();
};

#endif // QGRAPHICDIALOG_H
